package com.diploma.interaction.controller;

import com.alibaba.fastjson.JSON;
import com.diploma.interaction.model.WxxcxBdxx;
import com.diploma.interaction.service.BdxxService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/v1/bdxx")
@Slf4j
public class BdxxController {

    @Autowired
    BdxxService bdxxService;

    @PostMapping(value = "createBdxx",produces = "application/json")
    public void createBdxx(@RequestBody WxxcxBdxx bdxx){
        log.info("日志要这么写,article={}", JSON.toJSONString(bdxx));
        bdxxService.insertSelective(bdxx);
    }

    @PostMapping(value = "deleteBdxx",produces = "application/json")
    public void deleteBdxx(@RequestBody String tel){
        log.info("日志要这么写,tel={}", JSON.toJSONString(tel));
        bdxxService.deleteByTel(tel);
    }

    @PostMapping(value = "getBdxx",produces = "application/json")
    public WxxcxBdxx getBdxx(@RequestBody String tel){
        //isBindByTel
        log.info("日志要这么写,tel={}", JSON.toJSONString(tel));
        return bdxxService.selectByTel(tel);
    }



}
